<template>
    <view class="skeleton-order">
        <view class="skeleton-header">
            <view class="skeleton-store"></view>
            <view class="skeleton-status"></view>
        </view>

        <view class="skeleton-content">
            <view v-for="i in 3" :key="i" class="skeleton-image"></view>
            <view class="skeleton-price">
                <view class="skeleton-total"></view>
                <view class="skeleton-count"></view>
            </view>
        </view>

        <view class="skeleton-footer">
            <view class="skeleton-btn"></view>
        </view>
    </view>
</template>

<script setup>
const isActive = ref(true)
</script>

<style lang="scss" scoped>
.skeleton-order {
    background: #fff;
    margin: 20rpx;
    border-radius: 16rpx;
    padding: 24rpx;
    box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
}

.skeleton-item {
    background: linear-gradient(90deg,
            #f5f5f5 25%,
            #e8e8e8 50%,
            #f5f5f5 75%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8rpx;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 24rpx;
    border-bottom: 1rpx solid #eee;

    .skeleton-store {
        @extend .skeleton-item;
        width: 200rpx;
        height: 40rpx;
    }

    .skeleton-status {
        @extend .skeleton-item;
        width: 120rpx;
        height: 40rpx;
    }
}

.skeleton-content {
    padding: 24rpx 0;
    display: flex;

    .skeleton-image {
        @extend .skeleton-item;
        width: 120rpx;
        height: 120rpx;
        margin-right: 20rpx;
        border-radius: 8rpx;
    }

    .skeleton-price {
        flex: 1;
        margin-left: 20rpx;
        display: flex;
        flex-direction: column;
        gap: 16rpx;

        .skeleton-total {
            @extend .skeleton-item;
            width: 150rpx;
            height: 40rpx;
            align-self: flex-end;
        }

        .skeleton-count {
            @extend .skeleton-item;
            width: 180rpx;
            height: 32rpx;
        }
    }
}

.skeleton-footer {
    padding-top: 24rpx;
    border-top: 1rpx solid #eee;

    .skeleton-btn {
        @extend .skeleton-item;
        width: 160rpx;
        height: 60rpx;
        border-radius: 40rpx;
        margin-left: auto;
    }
}
</style>